import React, { Component } from 'react';
import "../styles/MySwiper.scss"

import { Swiper } from 'antd-mobile';

class MySwiper extends Component {
    constructor(props){
        super(props);
        this.state = {
            swiperlist: []
        }
    }
    
    render() {
        // console.log(this.props);
        return (
            <div className='myswiper'>
                <Swiper autoplay loop autoplayInterval={2000}>
                    {
                        this.props.swiperlist &&
                        this.props.swiperlist.map((item,index)=>{
                            return (
                                <Swiper.Item key={index}>
                                    <img src={item.pic} alt="" />
                                </Swiper.Item>
                            )
                        })
                    }
                </Swiper>
            </div>
        );
    }
}

export default MySwiper;